﻿using System.Configuration;
using System.IO.Ports;
using System.Windows;

namespace MainAppEntryPrismWpf.Views
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            string ShakerName = ConfigurationManager.AppSettings["PortName"];
            Utilities.Global.ComShaker = new SerialPort()
            {
                PortName = ShakerName,
                BaudRate = 9600,
                Parity = Parity.None,
                StopBits = StopBits.One,
                DataBits = 8,
            };

            if (Utilities.Global.ComShaker.IsOpen)
            {
                Utilities.Global.ComShaker.Close();
            }

            
        }
    }
}
